package nuig.prolog.Action;

import java.util.Map;
import nuig.prolog.BIZ.MainExecuteBiz;
import nuig.prolog.PrologAccess.IBaseAccess;
import org.apache.struts2.interceptor.SessionAware;



import com.opensymphony.xwork2.ActionSupport;

public class DefaultAction extends ActionSupport implements SessionAware {
	
	
	private Map<String, Object> session;//get session map
	private String UserTyping;
	private MainExecuteBiz bizExecuteBiz;
	
	
	//暂时使用的方法
	private IBaseAccess baseAccess;
	@Override
	public String execute()  {
		if(session.get("outputMessage")==null)
		{
			session.put("outputMessage", "initial");
		}else {
			String outputMessage=baseAccess.execute(UserTyping);
			session.put("outputMessage", outputMessage);
			//bizExecuteBiz.execute(UserTyping);
		}
		
		return SUCCESS;
	}
	
	
	
	
	
	
	/**
	 * get and set
	 */


	@Override
	public void setSession(Map<String, Object> Session) {
		this.session=Session;
		
	}

	public String getUserTyping() {
		return UserTyping;
	}


	public void setUserTyping(String userTyping) {
		UserTyping = userTyping;
	}

	public MainExecuteBiz getBizExecuteBiz() {
		return bizExecuteBiz;
	}

	public void setBizExecuteBiz(MainExecuteBiz bizExecuteBiz) {
		this.bizExecuteBiz = bizExecuteBiz;
	}
	
	public IBaseAccess getBaseAccess() {
		return baseAccess;
	}
	public void setBaseAccess(IBaseAccess baseAccess) {
		this.baseAccess = baseAccess;
	}


	/**
	 * 
	 * end of get and set
	 */

}
